home *** CD-ROM | disk | FTP | other *** search
- Functions transform input values and return a single value. Use
- functions in expressions any place a variable would be legal.
-
- DAN recognizes two types of functions; regular functions whose value is
- independent of any previous processing, and sequential functions whose
- returned value depends on the values previously passed to the function
- during the current implicit loop.
-
- Sequential functions produce running values derived from the data
- received so far in the implicit loop where they are invoked. They have
- no "foreknowledge" of succeeding values. Each sequential function,
- except READ, requires one Symbol Table entry for each invocation to use
- as a scratch pad area.
- +
- Regular Functions
- -----------------
- SIN(expr) COS(expr)
- TAN(expr) SINH(expr)
- COSH(expr) ARCSIN(expr)
- ARCCOS(expr) ARCTAN(expr)
- ARCSINH(expr) ARCCOSH(expr)
- LN(expr) LOG(expr)
- EXP(expr) EXP10(expr)
- SQRT(expr) ABS(expr)
- RAND(expr) D.TO.R(expr)
- R.TO.D(expr) DIGITAL(expr)
- DAC(chan,expr) DIGOUT(expr)
- ANALOG(expr) TIME
- TODAY ERF(expr)
- GAMMA(expr) BESSJ(orderexpr,expr)
- BESSY(orderexpr,expr) FFTRE(freqexpr)
- FFTIM(freqexpr) FFTMAG(freqexpr)
- FFTPHS(freqexpr) BIN(expr)
- PULSE(strtme,endtme) LIMIT(loexpr,expr,hiexpr)
- +
- Sequential Functions
- --------------------
- INTEGRAL (expr) AVG (expr)
- DERIV (expr) SUM (expr)
- DELTA (expr) STD.DEV (expr)
- PREV (expr) COUNT (expr)
- MIN (expr) TIMEOUT (loexpr,testexpr,hiexpr)
- MAX (expr) TIMEIN (loexpr,testexpr,hiexpr)
- READ
- +
- Function Notes
-
- Derivatives applied to sampled values are highly sensitive to noise.
- Imagine a flat line being approximated by samples that are alternately
- one count above and below the line. The samples nowhere differ from
- the actual line by more than one count but the derivative, which should
- be zero, will oscillate between positive and negative values and will
- never be zero. Small step sizes tend to accentuate this effect. It is
- recommended that the DERIV function only be applied to variables that
- were created with smoothing enabled and a large step size.
- +
- Use the TIMEOUT and TIMEIN functions to automatically determine the
- start time for significant data. For example, suppose the file
- ACTUAL.ACC contains acceleration data for a vehicle starting from rest
- and PREDICT.ACC contains predicted acceleration values (in G's) for the
- vehicle:
-
- START=TIMEOUT(-.1,ACTUAL.ACC-PREDICTED.ACC,.1)-.005;
-
- sets the start time for subsequent processing to 5 milliseconds before
- the difference between the measured and predicted accelerations exceeds
- .1 G's.
- +
- If 'testexpr' never breaks out of the specified bounds in the
- current processing period then the value returned is the first step
- time. Note that this function is applied only to values in the
- current processing period (i.e. as defined by START, BIAS, and
- DUR). The accuracy of this function is dependent on the step size
- since the out of bounds test is only made on the expression values
- at each step time. The values chosen for the lower and upper
- bounds should allow for noise in the sampled values. In the above
- example, the user is really interested in starting when the
- predicted value is not equal to the measured acceleration.
- However, lower and upper bounds of 0, while legal, would probably
- cause the start time to be set too early.
- +
- Note that AVG, SUM, COUNT, and STD.DEV will be invoked at each step
- time and thus will give the average/ sum/ count/ standard deviation of
- 'expr' values over all step times, not just at the actual data points
- in a file, unless you are running with INTERP=OFF.
-
- If you do a PLOT(READ) statement, DAN will draw the plot grid and label
- the fiducials after the first data point has been input. The program
- does not know at this time the processing span in the file being READ
- and hence will use the current DUR value (which may be considerably
- different than the duration of the data points in the file). To get
- around this limitation, either set the correct duration (if you know
- it), or do the following:
-
- filename = READ & SCALEY(filename);
- PLOT(filename);
-